﻿<%@ Control Language="C#" Inherits="Shop.Framework.Control.PagingControl" %>
<%if (PagingModel.TotalPage > 0) {%>
<ul class="page">
    <%for (int start = 1; start <= PagingModel.TotalPage; start++) {%>
    <%if (PagingModel.CurrentPage == start) { %>
    <li class="selected">
        <%if (IsCategory) {%>
        <%=Html.RouteLink(start.ToString(), new { Controller = "Product", Action = "NavigatePage", itemName = string.Format("Category-{0}", CurrentCategory.IdCategory), page = start, alias = CurrentCategory.Name.Sanitize() })%>
        <%} else if (IsDesigner) {%>
        <%=Html.RouteLink(start.ToString(), new { Controller = "Product", Action = "NavigatePage", itemName = string.Format("Designer-{0}", CurrentDesigner.IdDesigner), page = start, alias = CurrentDesigner.Name.Sanitize() })%>
        <%}%>
    </li>
    <%} else {%>
    <li>
        <%if (IsCategory) {%>
        <%=Html.RouteLink(start.ToString(), new { Controller = "Product", Action = "NavigatePage", itemName = string.Format("Category-{0}", CurrentCategory.IdCategory), page = start, alias = CurrentCategory.Name.Sanitize() })%>
        <%} else if (IsDesigner) {%>
        <%=Html.RouteLink(start.ToString(), new { Controller = "Product", Action = "NavigatePage", itemName = string.Format("Designer-{0}", CurrentDesigner.IdDesigner), page = start, alias = CurrentDesigner.Name.Sanitize() })%>
        <%}%>
    </li>
    <%}%>
    <%}%>
</ul>
<div class="clear">
</div>
<%}%>